package com.tree.common.exception;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @ClassName com.demo.common.exception
 * Description: 应用异常
 * <p>
 * 应用异常
 * </p>
 * @Author tree
 * @Date 2019-05-26 00:03
 * @Version 1.0
 */
@Data
@Accessors(chain = true)
public class AppException extends RuntimeException{
    static final long serialVersionUID = 1L ;

    protected int code;
    protected Object[] args;

    public AppException(){
        super();
    }

    public AppException(String message) {
        super(message);
    }

    public AppException(String message, Throwable cause){
        super(message,cause);
    }

    public AppException(int code,String message){
        super(message);
        this.code = code;
    }
    public AppException(int code, String message, Throwable cause){
        super(message,cause);
        this.code = code;
    }

    public AppException(String message, Object[] args){
        super(message);
        this.args = args;
    }

    public AppException(String message, Throwable cause, Object[] args){
        super(message,cause);
        this.args = args;
    }

    public AppException(int code,String message,Object[] args){
        super(message);
        this.code = code;
        this.args = args;
    }
    public AppException(int code,String message,Throwable cause, Object[] args){
        super(message,cause);
        this.code = code;
        this.args = args;
    }

//    public int getCode() {
//        return code;
//    }
//
//    public Object[] getArgs() {
//        return args;
//    }
}
